<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询申请状态</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="/layui/images/favicon.ico">
    <link rel="stylesheet" href="/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/layui/css/layuimini.css?v=2.0.4.2" media="all">
    <link rel="stylesheet" href="/layui/css/themes/default.css" media="all">
    <link rel="stylesheet" href="/layui/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <!--[if lt IE 9]-->
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/layui/css/forget.css">
</head>
<body>
<!-- login/register container -->
<div class="container">
    <!-- register -->
    <div class="form-container sign-up-container">
        <form class="layui-form login-bottom">
            <div class="form" style="margin-top: 70px;margin-left: 190px">
                <h2>查询入驻状态</h2>
                <input type="text" lay-verify="phone" name="phoneNum" id="phoneNum" placeholder="手机号">
                <div class="input" >
                    <table>
                        <tr>
                            <td>
                                <input style="width: 110px" type="Verification" name="Verification" id="Verification" placeholder="请输入验证码">
                            </td>
                            <td>
                                <button style="width: 160px; margin-left: 10px;" id="yanzheng">发送验证</button>
                            </td>
                        </tr>
                    </table>
                </div>
                <button id="button">查询</button>
            </div>
        </form>
    </div>

    <script src="/layui/js/forget.js"></script>
    <script src="/layui/js/login.js"></script>
    <script src="/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="/layui/js/lay-config.js?v=2.0.0" charset="utf-8"></script>
    <script>
        layui.use(['form','jquery'], function () {
            var $ = layui.jquery,
                form = layui.form,
                layer = layui.layer;


            var btn = document.querySelector('#yanzheng');
            var time = 60; // 定义剩下的秒数
            btn.addEventListener('click', function() {
                btn.disabled = true;
                var timer = setInterval(function() {
                    if (time == 0) {
                        // 清除定时器和复原按钮
                        clearInterval(timer);
                        btn.disabled = false;
                        btn.innerHTML = '发送验证';
                    } else {
                        btn.innerHTML = time + '秒';
                        time--;
                    }
                }, 1000);

                var phoneNum = $("#phoneNum").val();
                if (phoneNum == null || phoneNum == ''){
                    layer.msg("请先输入手机号")
                    return false;
                }

                $.ajax({
                    url: '/fogetMassage',
                    type: 'post',
                    data: 'phoneNum=' + phoneNum,
                    dataType: 'json',
                    success: function (result) {
                        console.log(result);
                        if (result.code == '0'){

                        }
                        layer.msg(result.msg)
                    }
                });
                return false;
            })

        });
        $(function (){
            $("#button").click(function (){
                $.ajax({
                    url: '/media/State',
                    type: 'post',
                    data: data,
                    dataType: 'json',
                    success: function (result) {
                        if (result.code == '0') {
                            alert("您已成功入驻");
                        } else {
                            layer.msg(result.msg);
                            return false;
                        }
                    }
                });
            })
        })
    </script>
</div>
</body>
</html>
